package dao.mongo;

import entity.mongo.User;
import org.springframework.data.domain.Pageable;
import org.springframework.data.mongodb.repository.ReactiveMongoRepository;
import org.springframework.stereotype.Repository;
import reactor.core.publisher.Flux;
import reactor.core.publisher.Mono;



@Repository
public interface UserRepository extends ReactiveMongoRepository<User, String> {

    Mono<Long> deleteUsersByUsername(String name);

    Mono<Long> countByUsernameLike(User user);

    Mono<User> findByUsername(String username);

    Flux<User> findByUsernameOrderByCreateTime(String username, Pageable pageable);
}
